package com.jhy.thread;

import java.util.ArrayList;
import java.util.Vector;

/**
 * @Description:
 * @authoer:jihaiyu
 * @date: 2017/6/19 18:09
 */
public class ArrayListMultThread {
    public static class AddThread implements Runnable{

        static Vector<Integer> arrayList = new Vector<Integer>(10);
        @Override
        public void run() {
            for(int i=0; i<10000000;i++){
                arrayList.add(i);
            }
        }

        public static void main(String[] args) throws InterruptedException{
            Thread t1 = new Thread(new AddThread());
            Thread t2 = new Thread(new AddThread());

            t1.start();
            t2.start();
            t1.join();t2.join();

            System.out.println(arrayList.size());
        }
    }
}
